/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"E5C61C57-94B4-458B-9EAB-BCB28927E1E1",variableType:8}
 */
var fTotalDebe = 0;

/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"AF85A2AA-1110-4B00-9C40-587BB2C2274F",variableType:8}
 */
var fTotalHaber = 0;

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"5CE72886-2250-4C0F-AA25-2491CC7861EC"}
 */
function onShow(firstShow, event) {
	// Calculo los totales
	var $fs = asiento_cab_to_asiento.duplicateFoundSet()
	
	fTotalDebe = 0
	fTotalHaber = 0
	
	for (var i = 1 ; i <= $fs.getSize() ; i++)
	{
		$fs.setSelectedIndex(i)
		if ($fs.importe_debe_cons != null)
		{
			fTotalDebe  += $fs.importe_debe_cons.toFixed(2)*1
		} 
		if ($fs.importe_haber_cons != null)
		{
			fTotalHaber += $fs.importe_haber_cons.toFixed(2)*1			
		}		
	}
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"01982338-2698-4ACD-9624-8D53421E24F3"}
 */
function onActionCerrar(event) {
	var $win = application.getWindow('ASIENTO_INDIVIDUAL')
	$win.hide()
	$win.destroy()
}
